home *** CD-ROM | disk | FTP | other *** search
/ Speccy ClassiX 1998 / Speccy ClassiX 98.iso / amiga_system / the_aminet / dev / amos / multipro.lha / MultiPro.AMOS / MultiPro.amosSourceCode
AMOS Source Code  |  1980-04-16  |  5KB  |  172 lines

  1. '
  2. ' To do list 
  3. ' ---------- 
  4. ' Work out method of storing all zone definitions prior to setting up the
  5. ' Multipro versions so that they can be restored on exiting the procedure. 
  6. '
  7. ' Work out method of either making sure the procedure does not keep on 
  8. ' loading all the font data each time the procedure is called or using 
  9. ' graphic data for the display instead of the dpaint font. 
  10. '
  11. ' Incorporate a for next loop so both joysticks can be read in the same
  12. ' routine so that you can shorten the code.
  13. '
  14. ' Work out the zone commands for the rest of the icons so that they can
  15. ' be implemented into the program even if you do not use them yet. Also
  16. ' look into methods of detecting if a screen is set up from the examined 
  17. ' program so that it can be called from the cycle buttons in MultiPro. 
  18. '
  19.  
  20. ' ***********************************************
  21. ' * MultiPro V2.0 by Anthony Brice, February 94 *
  22. ' *                                             *
  23. ' * This code is Give-It-Away-Ware, IE: I give  *
  24. ' * it away hoping someone finds it as useful   *
  25. ' * as I do. Please read the document file with *
  26. ' * this routine for additional information     *
  27. ' ***********************************************
  28. '
  29. ' Specify screen flag when calling MULTI as in example below for screen 0. 
  30. '
  31. ' Specify bank_number flag for the bank to store packed screens. If no bank
  32. ' is specified when they are loaded into another program then they will
  33. ' automatically reload into the same slot. 
  34. '
  35. ' The following two lines are to run the program with screen 0 displayed 
  36. ' and Bank 6 set for a packed screen.
  37. ' Delete them and call the routine from your own program to run MultiPro.
  38. '
  39.  
  40. MULTI[0,6]
  41. Edit 
  42.  
  43. Procedure MULTI[NUMBER_OF_SCREEN,BANK_NUMBER]
  44.    Get Fonts 
  45.    DISK$="Amos:Amos_Pro/Utilities/"
  46.    T=1 : MULTIFONT=0
  47.    Repeat 
  48.       TEST$=Left$(Font$(T),6)
  49.       If TEST$="dpaint"
  50.          MULTIFONT=T
  51.       End If 
  52.       T=T+1
  53.    Until MULTIFONT>0
  54.    Limit Mouse 0,0 To 640,300
  55.    Screen Open 1,320,200,16,Lowres
  56.    Curs Off : Flash Off : Cls 0
  57.    Load Iff DISK$+"MultiPro.IFF",1
  58.    Screen 1
  59.    Reserve Zone 4
  60.    Screen Display 1,130,160,320,60
  61.    Set Zone 1,91,32 To 104,40
  62.    Set Zone 2,107,32 To 116,40
  63.    Set Zone 3,120,32 To 125,40
  64.    Set Zone 4,6,0 To 232,15
  65.    Pen 1 : Paper 0
  66.    Locate 19,0
  67.    USER_HAS_QUIT=0
  68.    BEGIN:
  69.    Screen NUMBER_OF_SCREEN
  70.    X1=X Mouse : Y1=Y Mouse
  71.    X2=X Screen(X1) : Y2=Y Screen(Y1)
  72.    Screen 1
  73.    M=Mouse Zone
  74.    Set Font MULTIFONT : Ink 15,0
  75.    X$=Str$(X2)+" " : Y$=Str$(Y2)+" "
  76.    Text 15,25,"XPOS :"
  77.    Text 75,25,"YPOS :"
  78.    Text 45,25,X$
  79.    Text 105,25,Y$
  80.    If Mouse Key>0 and M=4
  81.       ' a couple of y parameters are skipped due to a graphic glitch.  
  82.       If Y2<>7 and Y2<>-3 and Y2<>202
  83.          Screen Display 1,130,Y1-5,320,60
  84.          If Mouse Key=1
  85.             Y Mouse=Y1-1
  86.          End If 
  87.          If Mouse Key=2
  88.             Y Mouse=Y1+1
  89.          End If 
  90.       End If 
  91.    End If 
  92.    A$=Inkey$
  93.    If A$<>""
  94.       B$=A$
  95.    End If 
  96.    S=Scancode
  97.    If S<>0
  98.       SC=S
  99.    End If 
  100.    Locate 0,2
  101.    'Print "Char: ";B$;" ";
  102.    Locate 10,2
  103.    'Print "ASC: ";Asc(B$);"  "; 
  104.    Locate 20,2
  105.    'Print "Scan:";SC;"  ";
  106.    If A$="n" or Mouse Key=1 and M=1
  107.       F$=Fsel$(DISK$,"","Select Normal Save Name")
  108.       If F$<>""
  109.          Save Iff F$,NUMBER_OF_SCREEN
  110.       End If 
  111.    End If 
  112.    If A$="p" or Mouse Key=1 and M=2
  113.       F$=Fsel$(DISK$,"","Select Packed File Name. .PACK will be added")
  114.       If F$<>""
  115.          Spack NUMBER_OF_SCREEN To BANK_NUMBER
  116.          F$=F$+".Pack"
  117.          Save F$,BANK_NUMBER
  118.       End If 
  119.    End If 
  120.    If Mouse Key=1 and M=3
  121.       USER_HAS_QUIT=1
  122.    End If 
  123.    Pen 3 : Locate 1,1
  124.    'Print "Joystick Port = "; 
  125.    If Jleft(1)
  126.       '   Print "Left "; 
  127.       Goto BEGIN
  128.    End If 
  129.    If Jright(1)
  130.       '   Print "Right"; 
  131.       Goto BEGIN
  132.    End If 
  133.    If Jup(1)
  134.       '   Print "Up   "; 
  135.       Goto BEGIN
  136.    End If 
  137.    If Jdown(1)
  138.       '   Print "Down "; 
  139.       Goto BEGIN
  140.    End If 
  141.    If Fire(1)
  142.       '   Print "Fire "; 
  143.       Goto BEGIN
  144.    End If 
  145.    '
  146.    ' The following routine is to check a joystick in the mouse port if fitted.
  147.    '
  148.    Pen 3 : Locate 30,1
  149.    'Print "Mouse Port = ";
  150.    If Jleft(0)
  151.       '   Print "Left "; 
  152.       Goto BEGIN
  153.    End If 
  154.    If Jright(0)
  155.       '   Print "Right"; 
  156.       Goto BEGIN
  157.    End If 
  158.    If Jup(0)
  159.       '   Print "Up   "; 
  160.       Goto BEGIN
  161.    End If 
  162.    If Jdown(0)
  163.       '   Print "Down "; 
  164.       Goto BEGIN
  165.    End If 
  166.    If Fire(0)
  167.       '   Print "Fire "; 
  168.    End If 
  169.    If USER_HAS_QUIT=0 Then Goto BEGIN
  170.    Screen Close 1
  171.    Erase BANK_NUMBER
  172. End Proc